<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>添加会员</title>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
<link rel="stylesheet" href="css/member.css" type="text/css"></link>
<%@include file="../collect/meta.jsp"%>
<script src="${ctx }/js/md5.js"></script>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>会员管理</li>
							<li>添加会员</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<div class="alert alert-success">
									<b>操作步骤：</b>
									<p>
										1. 输入手机号和姓名。<span>注意：相同手机号不可重复添加</span>
									</p>
									<p>2.点击确认添加按钮。</p>
									<p>3.显示添加成功后。点击查看会员，输入手机号搜索查看</p>
								</div>
								<!-- PAGE CONTENT BEGINS -->
								<form action="member!addMember?addplace=account"
									name="registerForm" id="registerForm" method="post">
									<div align="center">
										<div class="Mobile">
											<label for="mobile"><b>手机号:&nbsp;</b></label> <input type="text" class="input"
												id="mobile" name="member.mobile" placeholder="手机号不可修改">
											<div align="left" id="one"></div>
										</div>
										<div class="Name">
											<label for="name"><b>姓名:&nbsp;</b></label> <input type="text" class="input"
												id="name" name="member.name">
											<div align="left" id="three"></div>
										</div>
										<!-- <div class="common">
										        <label for="password">密码:&nbsp;</label> 
										        <input type="password" id="password" class="input" name="member.password" placeholder="密码">
										        <div align="left" id="two"></div>
										</div> -->
										<div id="btn-team">
											<button type="button" class="btn btn-primary radius"
												onclick="verifyRegister(this);">确认添加</button>
										</div>
										<b id="backMessage" style="font-size:25px;color:red;">${result
											}</b>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>
</body>
<script type="text/javascript">
	function verifyRegister(btn) {
		var mobile = document.getElementById("mobile").value;
		mobileReg = /^1[3|4|5|7|8][0-9]\d{8}$/;
		if (mobile.length == 0) {
			alert("请填写手机号！");
			return false;
		} else if (!mobileReg.test(mobile)) {
			alert("不是完整的11位手机号或者正确的手机号前3位！");
			return false;
		}

		var name = document.getElementById("name").value;
		var re = /^[\u4e00-\u9fa5a-z]+$/gi;
		if (!re.test(name)) {
			alert("名称中含有特殊字符！");
			return false;
		}

		btn.disabled = true;

		registerForm.submit();
	}

	$(document).ready(function() {
		setTimeout("$('#backMessage').hide()", 5000);
		/*
		$("#mobile").blur(function() {		
		// 验证手机号
		var mobile = $("input[id='mobile']").val();
		if (mobile.length == 0) {
			$("div[id='one']").html("<font color='red'>请输入手机号</font>");
			return false;
		}else {
			$("div[id='one']").html("");
		}
		$.ajax({
			async: false,
			url : "member!verifyMobile",
			type: "post",
			data : {
				"mobile" : mobile
			},
			datatype : "json",
			success : function(data) {
				var map = eval("(" + data + ")");
				if (map == null) {
				    sub = true;
					$("div[id='one']").html("");
				} else {
				    sub = false;
					$("div[id='one']").html("<font color='red'>" + map.temp + "</font>");
				}
			},
			error : function(request) {
			    sub = false;
				alert("Connection error");
			}
		  });
		});
		 */
	});

	//防收回；导入csv：$添加会员
	$('.membership > ul').show();
	$('.membership > ul > li > a').eq(2).css("color", "red");
</script>
</html>
